/**
 * 
 */
package mx.netbrain.bean;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;

import org.apache.log4j.Logger;

/**
 * @author julian
 * 
 */
public class WebBean {

	private static final Logger logger = Logger.getLogger(WebBean.class);
	private Properties PROPS = null;
	private String PROPS_PATH;
	private String protocol;
	private String hostname;
	private String port;
	private String name;
	private String search;

	public WebBean() {
		InstallBean installBean = new InstallBean();
		PROPS_PATH = installBean.getProperties();
		PROPS = new Properties();
		try {
			PROPS.load(new FileReader(PROPS_PATH + "appconfig.properties"));
			logger.info("Se carga el archivo properties: " + PROPS_PATH
					+ "appconfig.properties");
			protocol = PROPS.getProperty("app_protocol");
			hostname = PROPS.getProperty("app_host");
			port = PROPS.getProperty("app_port");
			name = PROPS.getProperty("app_name");
			search = PROPS.getProperty("external_search_url");
		} catch (FileNotFoundException e) {
			logger.error(e);
			e.printStackTrace();
		} catch (IOException e) {
			logger.error(e);
			e.printStackTrace();
		}
	}

	public String getProtocol() {
		return protocol;
	}

	public void setProtocol(String protocol) {
		this.protocol = protocol;
	}

	public String getHostname() {
		return hostname;
	}

	public void setHostname(String hostname) {
		this.hostname = hostname;
	}

	public String getPort() {
		return port;
	}

	public void setPort(String port) {
		this.port = port;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getSearch() {
		return search;
	}

	public void setSearch(String search) {
		this.search = search;
	}

}
